<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

</body>

</html>

<script>
  var month = +prompt('请输入月份');

  switch (month) {
    case 1:
    case 3:
    case 5:
    case 7:
    case 8:
    case 10:
    case 12:
      alert('本月有31天')
      break;
    case 4:
    case 6:
    case 9:
    case 11:
      alert('本月有30天')
      break;
    case 2:
      alert('本月有28天')
      break;
    default:
      alert('你输入的不是月份...');
      break;
  }
  /* 每个月分别是多少天？
    1 - 31
    2 - 28
    3 - 31
    4 - 30
    5 - 31
    6 - 30
    7 - 31
    8 - 31
    9 - 30
    10 - 31
    11 - 30
    12 - 31
  */
</script>